package com.example.mrzhou.lvmm.model.impl;

import com.example.mrzhou.lvmm.api.RetroManager;
import com.example.mrzhou.lvmm.api.TMService;
import com.example.mrzhou.lvmm.entity.tm.TM;
import com.example.mrzhou.lvmm.model.ITMModel;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Mr.zhou on 2016/10/29.
 */

public class TMModelImpl implements ITMModel {

    //    @Override
//    public void getTMData(Map<String, String> map, Map<String, String> params, Subscriber<TM> subscriber) {
//        RetroManager.getInstance(TMService.BASE_URL).getTMService().getTMData(map,params)
//                .observeOn(AndroidSchedulers.mainThread())
//                .subscribeOn(Schedulers.io())
//                .subscribe(subscriber);
//
//    }
    @Override
    public void getTMData(Map<String, String> map, Subscriber<TM> subscriber) {
        RetroManager.getInstance(TMService.BASE_URL).getTMService().getTMData(map)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);

    }

}
